import 'package:flutter/material.dart';
import 'package:flutter_swiper_view/flutter_swiper_view.dart';

class SwiperBannerTestPage extends StatefulWidget {
  const SwiperBannerTestPage({Key? key}) : super(key: key);

  @override
  State<SwiperBannerTestPage> createState() => _SwiperBannerTestPageState();
}

class _SwiperBannerTestPageState extends State<SwiperBannerTestPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("swiper banner test")),
      body: _buildBody(),
    );
  }

  Widget _buildBody() {
    return Column(
      mainAxisSize: MainAxisSize.max,
      children: [
        SizedBox(
          height: 200,
          width: 200,
          child: Swiper(
            itemBuilder: (BuildContext context, int index) {
              return Image.network(
                "https://img.tupobi.top/avatar.png",
              );
            },
            itemCount: 10,
            viewportFraction: 0.5,
            scale: 0.5,
            autoplay: true,
            autoplayDelay: 800,
          ),
        ),
      ],
    );
  }
}
